package com.github.bluzwang.fluxsupport;


import java.util.Map;

/**
 * Created by lgvalle on 22/07/15.
 */
public class Response {
    private final String type;
    private final Map<String, Object> dataMap;
    //private final Map<String, Class> dataClass;

    public Response(String type, Map<String, Object> dataMap/*, Map<String, Class> dataClass*/) {
        this.type = type;
        this.dataMap = dataMap;
        //this.dataClass = dataClass;
    }

    public String getType() {
        return type;
    }

    public Map getDataMap() {
        return dataMap;
    }

    public Object getData(String key) {
        if (dataMap != null && dataMap.size() > 0 && dataMap.containsKey(key)) {
            return dataMap.get(key);
        }
        return null;
    }
}
